////////////////////////////////////////////////////////////////////////////////////////////////////
/// @file   CollabRCBot\ConstantTreeNode.h
///
/// @brief  Declares the ConstantTreeNode class, an implementation of
///         a ComputationalTreeNode for constant inputs
////////////////////////////////////////////////////////////////////////////////////////////////////

#pragma once

#include "ComputationalTreeNode.h"

namespace CollabRC
{
    namespace Bot
    {
        namespace AI
        {
            /**
             * Implementation of a ComputationalTreeNode which represents
             * a constant value
             * @version $Id$
             * @author mpdelbuono
             */
            class ConstantTreeNode : public ComputationalTreeNode
            {
            private:
                /** The value of the node */
                const float m_value;

                /** Disallow use of the assignment operator */
                const ConstantTreeNode& operator=(const ConstantTreeNode& rhs);
            public:
                /**
                 * Creates a new ConstantTreeNode object initialized
                 * to the specified constant value
                 * @param value the constant value for this
                 * ConstantTreeNode to represent
                 */
                inline ConstantTreeNode(float value):m_value(value) { };

                
                /**
                 * @brief     Copy constructor for ConstantTreeNode
                 * @param     copy the instance to copy
                 */
                inline ConstantTreeNode(const ConstantTreeNode& copy):m_value(copy.m_value) { };

                /**
                 * Deallocates this ConstantTreeNode and all associated resources
                 */
                inline virtual ~ConstantTreeNode(void) { };

                virtual const ComputationalTreeNode& GetRandomBranch(unsigned int depth) const;
                virtual unsigned int GetBranchDepth() const;
                virtual ComputationalTreeNode* Clone() const;
                virtual ComputationalTreeNode* Mutate(unsigned int depth) const;
                virtual float Compute() const;
                virtual void Accept(ComputationalTreeNodeVisitor &visitor);
            };
        }
    }
}


